##############################
#
# WELCOME 
#
# This is the main cmake configuration file 
# associated with your project
# You can define specific compilation options here
# 
# More about cmake : www.cmake.org
#
# Using cmake command line : 
# 1. Create a build directory : mkdir build
# 2. Configure cmake project : cd build; cmake ..
#   You can also generate project with your favorite IDE : 
#   Example : Under Mac osx use "cmake .. -G XCode"
#   see cmake help for more information
# 3. Edit project option : ccmake .
# 4. Build it : make 


# This file was generated by Aldebaran Robotics ModuleGenerator

############################ PROJECT NAME
PROJECT( NAOVISIONCLIENT )
MESSAGE( STATUS "" )
MESSAGE( STATUS "...:::: Configuration -  NAOVISIONCLIENT ::::..." )

IF (WIN32)
SET(CMAKE_DEBUG_POSTFIX _d)
ENDIF (WIN32)


############################ VERSION
# Check cMake version
CMAKE_MINIMUM_REQUIRED( VERSION 2.2.0 )




############################ COLORIZE MAKEFILE
# Colorized output
SET( CMAKE_COLOR_MAKEFILE TRUE )

########################### BOOST INCLUDE
INCLUDE_DIRECTORIES(  ${BOOST_INCLUDE_DIR} )

############################ ENVIRONMENT VARIABLE AL_DIR
# Check that AL_DIR is set.
# Otherwise, try to set it - first by running findroot.cmake script; else retrieving the AL_DIR environment variable.
IF ( "x${AL_DIR}x" STREQUAL "xx"  )
  IF (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../findroot.cmake  )
        MESSAGE( STATUS "Could not find findroot.cmake in parent folder")
        IF( "x$ENV{AL_DIR}x" STREQUAL "xx" )
          MESSAGE( FATAL_ERROR "Please move your project to naoqi/modules/src directory or set the environment variable AL_DIR to the naoqi directory!" )
        ELSE( "x$ENV{AL_DIR}x" STREQUAL "xx" )
          SET( AL_DIR "$ENV{AL_DIR}" )
          MESSAGE( STATUS "Retrieve AL_DIR environment variable to set Naoqi folder")
        ENDIF ( "x$ENV{AL_DIR}x" STREQUAL "xx" )
  ELSE (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../findroot.cmake  )
        MESSAGE( STATUS "Run findroot.cmake to find Naoqi folder")
        INCLUDE ( ../findroot.cmake )
  ENDIF (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../findroot.cmake  )
  MESSAGE( STATUS "Naoqi folder is now set to ${AL_DIR}")
ENDIF("x${AL_DIR}x" STREQUAL "xx" )

############################ LIBRARY OR EXECUTABLE?
# Create an option to compile module as a libray
# or as a remote executable
OPTION(  NAOVISIONCLIENT_IS_REMOTE
    " naovisionclient module is compiled as a remote module (ON or OFF)"
    ON
  )



############################ CMAKE PACKAGE DIRECTORY
# Set cmakeModules folder
SET( CMAKE_MODULE_PATH ${AL_DIR}/cmakemodules )




############################ ALDEBARAN CMAKE FILE
# Include aldebaran config file 
# (platform management)

INCLUDE( "${CMAKE_MODULE_PATH}/aldebaran.cmake" )


############################ FIND PACKAGE
# Libraries specifics. Define here cmake packages
# usefull to your project

FIND_PACKAGE( ALCOMMON REQUIRED )
FIND_PACKAGE( TINYXML REQUIRED )
FIND_PACKAGE( PTHREAD REQUIRED )
FIND_PACKAGE( BOOST REQUIRED )
FIND_PACKAGE( OPENCV REQUIRED )
FIND_PACKAGE( PYTHON REQUIRED )

#INCLUDE_DIRECTORIES(/usr/local/include/opencv)
#SET (OpenCV_LIBS "debug cv" "optimized cv" "debug highgui" "optimized highgui" "debug cxcore" "optimized cxcore")
#SET (OpenCV_LIBS "${AL_DIR}/extern/c/linux/lib/libcv.so" "${AL_DIR}/extern/c/linux/lib/libhighgui.so" "${AL_DIR}/extern/c/linux/lib/libcxcore.so" "${AL_DIR}/extern/c/linux/lib/libcvaux.so")


#
########################### OUTPUT LOCATION
# Define output directories
SET( OUTPUT_ROOT_DIR_EXE "${AL_DIR}/modules/bin/" )
SET( OUTPUT_ROOT_DIR_LIB "${AL_DIR}/modules/lib/" )


############################ CONFIG.H GENERATION
IF ( EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/config.in"  )
  CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/config.in"
    "${CMAKE_CURRENT_SOURCE_DIR}/src/config.h"
      ESCAPE_QUOTES
  )
ENDIF(  EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/config.in"  )




############################ SUBDIRECTORIES INCLUSION
# Compile folders
SUBDIRS( src )
#
